home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / CModalProgress 1.1 / CTestDialogs.h < prev    next >
Text File  |  1994-09-01  |  3KB  |  108 lines

  1. // ===========================================================================
  2. //    CTestDialogs.h
  3. //
  4. //    This file contains the header information for the example code to
  5. //    demonstrate the functionality of the CModalProgress class.
  6. //
  7. //    Copyright 1994 Alysoft Solutions. All rights reserved.
  8. //
  9. // ===========================================================================
  10.  
  11. #pragma once
  12.  
  13. #include "CModalProgress.h"
  14.  
  15. void TestDialog1(void) ;
  16. void TestDialog2(void) ;
  17. void TestDialog3(void) ;
  18. void TestDialog4(void) ;
  19.  
  20. /*
  21.  *    Test 1 Just a simple example, has no sub-classing, just some res ids
  22.  */
  23.  
  24. #define    kTest1DialogResID                128
  25. #define    kTest1ProgressBarItem            4
  26.  
  27. /*
  28.  *    Test 2 creates a sub-class of the main progress class
  29.  */
  30.  
  31. enum
  32. {
  33.     kTest2State1                = 65,
  34.     kTest2State1StateSpace                    = 100,
  35.     kTest2State2                = 80,
  36.     kTest2State2StateSpace                    = 100,
  37.     kTest2State3                = 100,
  38.     kTest2State3StateSpace                    = 100
  39. } ;
  40.  
  41. #define    kTest2State1String                "\pCompiling File: TestFile.cp"
  42. #define kTest2State2String                "\pLinking: TestApplication"
  43. #define    kTest2State3String                "\pCopying Resources"
  44.  
  45. #define    kTest2DialogResID                129
  46. #define    kTest2ProgressBarItem            4
  47. #define    kTest2ItemText                    5
  48.  
  49. class CDialog2 : public CModalProgress
  50. {
  51.     public:
  52.         void SetCurrentState(float statePercent) ;
  53.     
  54. } ;
  55.  
  56. /*
  57.  *    Test 3 uses the infinite progress bar in a search type dialog
  58.  */
  59.  
  60. #define    kTest3DialogResID                130
  61. #define    kTest3InfiniteBarItem            4
  62.  
  63. /*
  64.  *     Test 4 uses lots of states, more customization of the base class with
  65.  *    the addition of an extra method to set a file name text field.
  66.  */
  67.  
  68. enum
  69. {
  70.     kTest4ConnectState            = 5,
  71.     kTest4LoginState            = 10,
  72.     kTest4DownloadState            = 70,
  73.     kTest4DownloadStateSpace                = 2000,
  74.     kTest4File1StateSpace                    = 500,
  75.     kTest4File2StateSpace                    = 1000,
  76.     kTest4File3StateSpace                    = 500,
  77.     kTest4SetParamsState        = 80,
  78.     kTest4LogoffState            = 85,
  79.     kTest4DisconnectState        = 90,
  80.     kTest4CleanupState            = 100,
  81.     kTest4StandardStateSpace                = 500
  82. } ;
  83.  
  84. #define    kTest4ConnectStateString        "\pConnecting"
  85. #define    kTest4LoginStateString            "\pLogin"
  86. #define    kTest4DownloadStateString        "\pDownlad Files"
  87. #define    kTest4DownloadFileNone            "\p"
  88. #define    kTest4DownloadFile1                "\puserparams.txt"
  89. #define    kTest4DownloadFile2                "\pmainscript.txt"
  90. #define    kTest4DownloadFile3                "\pconfig.txt"
  91. #define    kTest4SetParamsStateString        "\pSetting Parameters"
  92. #define    kTest4LogoffStateString            "\pLogoff"
  93. #define    kTest4DisconnectStateString        "\pDisconnecting"
  94. #define    kTest4CleanupStateString        "\pCleanup"
  95.  
  96. #define    kTest4DialogResID                131
  97. #define    kTest4ProgressBarItem            4
  98. #define    kTest4StateTextItem                5
  99. #define    kTest4FileNameTextItem            6
  100. #define    kTest4PercentTextItem            10
  101.  
  102. class CDialog4 : public CModalProgress
  103. {
  104.     public:
  105.         void SetCurrentState(float statePercent) ;
  106.         void SetFileName(Str255 filename) ;
  107. } ;
  108.